package org.dousb.doupicture.interfaces.assembler;


import org.dousb.doupicture.domain.user.entity.User;
import org.dousb.doupicture.interfaces.dto.user.UserAddRequest;
import org.dousb.doupicture.interfaces.dto.user.UserUpdateRequest;
import org.springframework.beans.BeanUtils;

/**
 * UserAssembler
 * 用户对象转换
 *
 * @author 豆沙包
 * @version 1.0
 * @since 2025-11-07  17:55
 */
public class UserAssembler {

    public static User toUserEntity(UserAddRequest userAddRequest) {
        User user = new User();
        BeanUtils.copyProperties(userAddRequest, user);
        return user;
    }

    public static User toUserEntity(UserUpdateRequest userUpdateRequest) {
        User user = new User();
        BeanUtils.copyProperties(userUpdateRequest, user);
        return user;
    }
}